<%@page import="java.sql.Connection"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@page import="java.util.ArrayList, model.Course, model.Session, servlets.AServlet"%>
<%@page import="database.DBHandler"%>
<%@include file="/WEB-INF/JSP-Files/headline.jsp" %>
<div id="content">
	<h2>Choose a calendar style</h2>
	<a href="#" onclick="javascript:window.open('/skiryanoandspuzir/Calendar?getStyle=style1','calendar')">Style 1</a>
	<a href="#" onclick="javascript:window.open('/skiryanoandspuzir/Calendar?getStyle=style2','calendar')">Style 2</a>
	<br /><br />
	Want to make your own? Upload a stylesheet that conforms to <a href="timetable.dtd">this</a> dtd. 
	<form action="/skiryanoandspuzir/Calendar" method="post" enctype="multipart/form-data">
		<div>
			<input type="file" name="xsltFile"/>
			<input type="submit" value="Upload" name="fileUpload"/>
		</div>
	</form>
	<h3>User Stylesheets</h3>
	<% Connection con = DBHandler.getHandler().getLocalCon();
	for (String s : DBHandler.getHandler().getStyleSheetNames((String)request.getSession().getAttribute("LoginName"), con)) {%>
		<a href="#" onClick="javascript:window.open('/skiryanoandspuzir/Calendar?getStyle=<%=s %>','calendar', 'width=310,height=300,scrollbars=no')"><%= s%></a>
	<%}
	AServlet.finishTransaction(con, false);
	DBHandler.getHandler().returnLocalCon(con);
	%>
</div>
</body>
</html>